Actually commit the "stat less" patch which appeared in the ChangeLog a
authorMatthias Clasen <mclasen@redhat.com>
Tue, 2 Nov 2004 02:07:30 +0000 (02:07 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 2 Nov 2004 02:07:30 +0000 (02:07 +0000)
2004-11-01  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkicontheme.c: Actually commit the "stat less" patch
which appeared in the ChangeLog a few days ago.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkicontheme.c

index 5f7f55821b1a42b10dd41d86c92068af341d24a3..4ba1d9bf935546356ebf54461b8aa0a677fe228f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-11-01  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c: Actually commit the "stat less" patch
+       which appeared in the ChangeLog a few days ago.
+
        * gtk/gtkfilechooserbutton.c: Move some docs inline.
 
        * gtk/gtkaboutdialog.c (gtk_show_about_dialog): Doc update.
@@ -17,7 +20,8 @@
 
        * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the
        state of the cell view when the state of the button changes (to 
-       get prelighted drawing right).  (#138650, Frances Keenan, Christian Persch)
+       get prelighted drawing right).  (#138650, Frances Keenan, 
+       Christian Persch)
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
        Don't force the height of the action area, we don't scroll 
index 5f7f55821b1a42b10dd41d86c92068af341d24a3..4ba1d9bf935546356ebf54461b8aa0a677fe228f 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-01  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c: Actually commit the "stat less" patch
+       which appeared in the ChangeLog a few days ago.
+
        * gtk/gtkfilechooserbutton.c: Move some docs inline.
 
        * gtk/gtkaboutdialog.c (gtk_show_about_dialog): Doc update.
@@ -17,7 +20,8 @@
 
        * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the
        state of the cell view when the state of the button changes (to 
-       get prelighted drawing right).  (#138650, Frances Keenan, Christian Persch)
+       get prelighted drawing right).  (#138650, Frances Keenan, 
+       Christian Persch)
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
        Don't force the height of the action area, we don't scroll 
index 5f7f55821b1a42b10dd41d86c92068af341d24a3..4ba1d9bf935546356ebf54461b8aa0a677fe228f 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-01  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c: Actually commit the "stat less" patch
+       which appeared in the ChangeLog a few days ago.
+
        * gtk/gtkfilechooserbutton.c: Move some docs inline.
 
        * gtk/gtkaboutdialog.c (gtk_show_about_dialog): Doc update.
@@ -17,7 +20,8 @@
 
        * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the
        state of the cell view when the state of the button changes (to 
-       get prelighted drawing right).  (#138650, Frances Keenan, Christian Persch)
+       get prelighted drawing right).  (#138650, Frances Keenan, 
+       Christian Persch)
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
        Don't force the height of the action area, we don't scroll 
index 5f7f55821b1a42b10dd41d86c92068af341d24a3..4ba1d9bf935546356ebf54461b8aa0a677fe228f 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-01  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkicontheme.c: Actually commit the "stat less" patch
+       which appeared in the ChangeLog a few days ago.
+
        * gtk/gtkfilechooserbutton.c: Move some docs inline.
 
        * gtk/gtkaboutdialog.c (gtk_show_about_dialog): Doc update.
@@ -17,7 +20,8 @@
 
        * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the
        state of the cell view when the state of the button changes (to 
-       get prelighted drawing right).  (#138650, Frances Keenan, Christian Persch)
+       get prelighted drawing right).  (#138650, Frances Keenan, 
+       Christian Persch)
 
        * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
        Don't force the height of the action area, we don't scroll 
index dfce91604a1e55997420bd9b079047f68b3d6f74..e095fc6cb1906a2527335b0ac5d0a06cfa4dd441 100644 (file)
@@ -890,6 +890,7 @@ insert_theme (GtkIconTheme *icon_theme, const char *theme_name)
 
       priv->dir_mtimes = g_list_prepend (priv->dir_mtimes, dir_mtime);
     }
+  priv->dir_mtimes = g_list_reverse (priv->dir_mtimes);
 
   theme_file = NULL;
   for (i = 0; i < priv->search_path_len && !theme_file; i++)
@@ -2082,7 +2083,7 @@ theme_subdir_load (GtkIconTheme *icon_theme,
                   GKeyFile     *theme_file,
                   char         *subdir)
 {
-  int base;
+  GList *d;
   char *type_string;
   IconThemeDir *dir;
   IconThemeDirType type;
@@ -2094,6 +2095,8 @@ theme_subdir_load (GtkIconTheme *icon_theme,
   int threshold;
   char *full_dir;
   GError *error = NULL;
+  GtkIconCache *cache;
+  IconThemeDirMtime *dir_mtime;
 
   size = g_key_file_get_integer (theme_file, subdir, "Size", &error);
   if (error)
@@ -2152,37 +2155,30 @@ theme_subdir_load (GtkIconTheme *icon_theme,
       g_error_free (error);
       error = NULL;
     }
-  
-  for (base = 0; base < icon_theme->priv->search_path_len; base++)
+
+  for (d = icon_theme->priv->dir_mtimes; d; d = d->next)
     {
-      GtkIconCache *cache;
-      gchar *theme_path;
+      dir_mtime = (IconThemeDirMtime *)d->data;
+
+      if (dir_mtime->mtime == 0)
+       continue; /* directory doesn't exist */
 
-      full_dir = g_build_filename (icon_theme->priv->search_path[base],
-                                  theme->name,
-                                  subdir,
-                                  NULL);
+       full_dir = g_build_filename (dir_mtime->dir, subdir, NULL);
 
       /* First, see if we have a cache for the directory */
       if (!theme->icon_caches)
        theme->icon_caches = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                    g_free, (GDestroyNotify)free_cache);
                                                   
-      theme_path = g_build_filename (icon_theme->priv->search_path[base],
-                                    theme->name,
-                                    NULL);
-         
-      if (!g_hash_table_lookup_extended (theme->icon_caches, theme_path, 
+      if (!g_hash_table_lookup_extended (theme->icon_caches, dir_mtime->dir, 
                                         NULL, (gpointer)&cache))
        {
          /* This will return NULL if the cache doesn't exist or is outdated */
-         cache = _gtk_icon_cache_new_for_path (theme_path);
+         cache = _gtk_icon_cache_new_for_path (dir_mtime->dir);
 
-         g_hash_table_insert (theme->icon_caches, g_strdup (theme_path), cache);
+         g_hash_table_insert (theme->icon_caches, g_strdup (dir_mtime->dir), cache);
        }
 
-      g_free (theme_path);
-
       if (cache != NULL || g_file_test (full_dir, G_FILE_TEST_IS_DIR))
        {
          dir = g_new (IconThemeDir, 1);